{include file="header.tpl"}

	<h1>Manage Attachments - {$ticket.id}</h1>

   <div id="content">
   
      {include file="flashes.tpl"}
      
      <div class="action_bar">
         <a class="back" href="{$spf.base_url}/tickets/view/{$ticket.id}">Back to ticket</a>
      </div>
      
   	<form id="frm_attachment" action="" method="post" enctype="multipart/form-data">
   
   		<fieldset class="panel">
   			
   			<div>
   				<label for="src_file">New Attachment:</label>
        			<input id="src_file" name="src_file" type="file" value="{$attachment.src_file}" />
        			{if $attachment.errors.description}<p class="error">{$attachment.errors.description}</p>{/if}
        			<p class="rules">Maximum Size: {$max_size}</p>
   	 		</div>
   			
   		<div class="button_bar">
   			<button type="submit" name="submit_frm_attachment" value="1">Upload</button>
   		</div>
   		
   		</fieldset>
   		
   	</form>
   	
      <div class="clear"></div>
      
      <table id="attachments">
         <tr>
            <th>Name</th>
            <th>Type</th>
            <th>Size</th>
            <th>Uploaded</th>
            <th class="center">Delete</th>
         </tr>
         {foreach item=attachment from=$attachments}
         <tr>
            <td class="name {$attachment.system_type|lower}"><a class="{$attachment.system_type|lower}" href="{$spf.base_url}/tickets/download_attachment/{$attachment.ticket_id}/{$attachment.id}">{$attachment.file_name}</a></td>
            <td>{$attachment.document_type}</td>
            <td>{$attachment.file_size}</td>
            <td>{$attachment.uploaded}</td>
            <td class="delete"><a href="#" onclick="spf.sitrack.confirm('/tickets/delete_attachment/{$attachment.ticket_id}/{$attachment.id}')"></a></td>
         </tr>
         {/foreach}
      </table>
      
   </div>
   
{include file="footer.tpl"}
